home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / dfs236s.zip / DFSINFO.cmd < prev    next >
OS/2 REXX Batch file  |  1997-07-06  |  3KB  |  105 lines

  1. /* Analyse current status of all physical disks,             JvW 21-01-97    */
  2. /* partition tables and partition format information                         */
  3. /* Then, for all HPFS partitions, show basic information                     */
  4. /* and find the Root-directory and Codepage info without                     */
  5. /* using the superblock or spareblock pointers                               */
  6. /* All results will be contained in the logfile DFSINFO.TXT                  */
  7.  
  8.    Parse Source with . myself .
  9.  
  10.    Parse Arg logname
  11.    if logname = '' then
  12.    do
  13.       logname = 'dfsinfo.txt'
  14.    end
  15.  
  16.    if Address() <> 'DFS' then
  17.    do
  18.       Address cmd '@dfs runq' myself logname
  19.    end; else
  20.    do
  21.       Address cmd '@del' logname
  22.       '@log' logname
  23.  
  24.       say date('E') time()': Gathering diagnostic information; Please wait ...'
  25.       say ''
  26.       'close'                                   /* release physical disks    */
  27.  
  28.       say 'First get the standard available stuff ...'
  29.       'fdisk /query'
  30.  
  31.       'setboot /query'
  32.  
  33.       say "And when available, Doug's partition overview too!"
  34.       'chkpart'
  35.  
  36.       say 'Now use our own built-in diagnostic power ...'
  37.  
  38.       'disk 0'
  39.       physdisks  = rc                           /* get number of disks       */
  40.  
  41.       do i=1 to physdisks
  42.          Say ''
  43.          Say 'MBR/EBR chain for disk nr' i
  44.          'walk' i                               /* select next disk and show */
  45.       end                                       /* it's MBR/EBR chain        */
  46.  
  47.       'part +'                                  /* show all partition info   */
  48.       partitions = rc                           /* and remember the count    */
  49.  
  50.       do i=1 to partitions
  51.          'part' i                               /* select next partition     */
  52.  
  53.          Say ''
  54.          Say 'Working on partition' i '=' dfs_drive 'on disk' dfs_disknr
  55.          if substr(dfs_drive,2,1) = ':' then
  56.          do
  57.             Say ''
  58.             Say 'Running CHKDSK on the partition ...'
  59.             'chkdsk' dfs_drive
  60.  
  61.             Say ''
  62.             Say 'Attempt a normal directory of its root directory'
  63.             'dir' dfs_drive'\'
  64.          end
  65.  
  66.          Say ''
  67.          if dfs_afsys = 'HPFS' then
  68.          do
  69.             if substr(dfs_drive,2,1) = ':' then
  70.             do
  71.                Say "Running Doug's HVA if available ..."
  72.                'hva -e -r -s' dfs_drive'\*'
  73.             end
  74.  
  75.             Say ''
  76.             Say 'Running some DFS HPFS diagnostics ...'
  77.             't H'
  78.             ' '
  79.             ' '
  80.             ' '
  81.             '11'
  82.             't H'
  83.             ' '
  84.             ' '
  85.             '0'
  86.             'findroot'
  87.             ' '
  88.             ' '
  89.             ' '
  90.             '0'
  91.             'f c'
  92.             ' '
  93.             'm'
  94.             'a'
  95.          end; else
  96.          do
  97.             Say 'No specific diagnostics for filesystem' dfs_afsys '(yet).'
  98.             't H'
  99.          end
  100.       end
  101.       say date('E') time()': Gathering diagnostic information finished.'
  102.       '@log'                                    /* close the log file        */
  103.    end
  104. exit 0
  105.